package com.agou.core.enums;


public enum EnTreeNodeType implements IEnum{
	Node("结点", 1),Link("叶子", 2);
	// 成员变量
	private String enumName;
	private int enumCode;

	// 构造方法
	private EnTreeNodeType(String name, int code) {
		this.enumName = name;
		this.enumCode = code;
	}

	public String getName() {
		return enumName;
	}

	public int getCode() {
		return enumCode;
	}

	// 普通方法
	public static String getEnumName(int code) {
		for (EnTreeNodeType c : EnTreeNodeType.values()) {
			if (c.getCode() == code) {
				return c.enumName;
			}
		}
		return null;
	}
	
	public static EnTreeNodeType getEnum(int code) {
		for (EnTreeNodeType c : EnTreeNodeType.values()) {
			if (c.getCode() == code) {
				return c;
			}
		}
		return null;
	}
}
